package elearning.service;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Service;

import elearning.dao.CategoryDao;
import elearning.model.ToeicCategory;


@Service("categoryService")
@Scope(value="singleton",proxyMode=ScopedProxyMode.TARGET_CLASS)
public class CategoryServiceImpl implements CategoryService,Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Autowired
	CategoryDao categoryDao;
	@Override
	public List<ToeicCategory> queryAll() {
		return categoryDao.queryAll();
	}
	@Override
	public ToeicCategory create( ToeicCategory category) {
		return categoryDao.save(category);
	}
	@Override
	public ToeicCategory update( ToeicCategory category) {
		return categoryDao.update(category);
	}
	@Override
	public ToeicCategory get(Integer id) {
		return categoryDao.get(id);
	}
}
